<template>
  <div style="height:100%;width:100%;position:relative;overflow: hidden;">
      <div class="pagetop">
          <div class="search-title">快速查询</div>
          <el-input v-model.trim="txtSearch" @input="filterData" placeholder="试验代码| 试验名称丨输入码" style="width:200px"></el-input>
          <div class="top-deal">
              <el-button icon="el-icon-search" type="primary" @click="btnQuery" v-has="'PINQUERY'" :disabled="changeflag">查询</el-button>

              <el-button icon="el-icon-plus" @click="MainOpenDialog(1)" v-has="'PADD'" :disabled="changeflag">新增</el-button>

              <el-button icon="el-icon-delete" @click="MainOpenDialog(2)" v-has="'PDELETE'" :disabled="changeflag">删除</el-button>
              <el-button icon="el-icon-document" @click="MainOpenDialog(3)" v-has="'PDELETE'" :disabled="!changeflag">保存</el-button>

              <el-button icon="el-icon-close" @click="MainOpenDialog(4)" v-has="'PDELETE'" :disabled="!changeflag">取消</el-button>
              <el-button icon="el-icon-upload2" @click="btnExport" v-has="'PEXPORT'" style="margin-left: 10px">导出</el-button>
              <el-button icon="el-icon-files" @click="ImportCsv" ref="importFile">导入</el-button>
              <div class="upload-button">
                  <el-upload ref="upload" :action="url" accept=".dat" :before-upload="beforeUploadFile" :on-change="fileChange" :show-file-list="showFile" :data="updata" :http-request="uploadOpt">
                      <el-button size="small" plain>选择文件</el-button>
                      <!-- <div slot="tip" class="el-upload__tip">只能上传DAT(*dat)文件，且不超过10M</div> -->
                  </el-upload>
              </div>
          </div>
      </div>
      <div class="pagecenter">
          <rm-layout-right :splitwidth="5" :fixsize="636" :canDrag="false">
              <div class="pagecenter-left">
                  <vxe-table show-overflow ref="lxTable" :data.sync="searchList" class="mytable-style" height="auto" :loading="lxTableLoading" :sort-config="{trigger: 'cell'}" :keyboard-config="keyConfig" :keyboard-local-config="keyLocalConfig" border size="mini" show-header-overflow highlight-current-row resizable stripe header-align="center" :row-class-name="rowClassName" @current-change="CurrentChangeEvent">
                      <vxe-table-column type="index" width="60" title="No."></vxe-table-column>
                      <vxe-table-column field="testno" title="试验代码" width="120"></vxe-table-column>
                      <vxe-table-column field="testname" title="试验名称" width="200"></vxe-table-column>
                      <vxe-table-column field="testtype" title="试验类型" :formatter="format" width="100"></vxe-table-column>
                      <vxe-table-column field="inputcode" title="输入码" width="120"></vxe-table-column>
                      <vxe-table-column field="seq" title="序号" width="100"></vxe-table-column>
                  </vxe-table>
              </div>
              <template v-slot:fix>
                  <rm-layout-top splitcolor="#ffffff" :splitwidth="5" :fixsize="95" :canDrag="false">
                      <template v-slot:fix>
                          <div class=" pagecenter-right-top">
                              <table>
                                  <tr>
                                      <td style="color:#F56C6C;text-align: right; ">试验代码</td>
                                      <td>
                                          <el-input v-model="detailData.testno" placeholder="" ref="input11" @keyup.enter.native="nextFocus(1, 1)" style="width:150px;" :disabled="isdisabeld"></el-input>
                                      </td>
                                      <td style="text-align: right; ">序号</td>
                                      <td>
                                          <el-input v-model="detailData.seq" placeholder="" @input="hasChange" ref="input12" @keyup.enter.native="nextFocus(1, 2)" style="width:150px;"></el-input>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td style="color:#F56C6C;text-align: right; ">试验名称</td>
                                      <td>
                                          <el-input v-model="detailData.testname" placeholder="" @input="hasChange" ref="input13" @keyup.enter.native="nextFocus(1, 3)" style="width:150px;" @blur="TxtInputCode"></el-input>
                                      </td>
                                      <td style="text-align: right; ">输入码</td>
                                      <td>
                                          <el-input v-model="detailData.inputcode" placeholder="" @input="hasChange" ref="input14" @keyup.enter.native="nextFocus(1, 4)" style="width:150px;"></el-input>
                                      </td>
                                  </tr>
                                  <tr>
                                      <td style="text-align: right; ">试验类型</td>
                                      <td colspan="3">
                                          <el-radio-group v-model="detailData.testtype" @change="hasChange">
                                              <el-radio ref="input15" @keyup.enter.native="nextFocus(1, 5)" :label="'1'">生化反应</el-radio>
                                              <el-radio :label="'2'">血清试验</el-radio>
                                              <el-radio :label="'9'">其他</el-radio>
                                          </el-radio-group>
                                      </td>
                                  </tr>
                              </table>
                          </div>
                      </template>
                      <div style="height: calc(100% - 40px)">
                          <vxe-table show-overflow ref="rxTable" class="mytable-style" :data.sync="detailxTData" height="auto" :loading="rptItemLoading" :edit-config="{
                trigger: 'click',
                mode: 'cell',
                showStatus: true,
                showIcon: false,
              }" @cell-dblclick="CellDblclick" border size="mini" show-header-overflow highlight-current-row highlight-hover-row resizable stripe header-align="center" @edit-closed="EditClose" :row-class-name="rowClassName2">
                              <vxe-table-column field="testno" title="试验代码" width="100" sortable><template v-slot:header="{column}"><span style="color:#F56C6C;">试验代码</span></template></vxe-table-column>
                              <vxe-table-column field="shapes" title="形态描述" width="250" :edit-render="{name: 'input', events: {change: hasChange}}" sortable><template v-slot:header="{column}"><span style="color:#F56C6C;">形态描述</span></template></vxe-table-column>
                              <vxe-table-column field="inputcode" title="输入码" width="100" :edit-render="{name: 'input', events: {change: hasChange}}" sortable></vxe-table-column>
                              <vxe-table-column field="seq" title="序号" align="right" width="55" :edit-render="{name: 'input', events: {change: hasChange}}" sortable><template v-slot:header="{column}"><span style="color:#F56C6C">序号</span></template></vxe-table-column>
                          </vxe-table>

                          <div class="top-table">
                              <el-button icon="el-icon-plus" @click="MainOpenDialog(5)" v-has="'PADD'">新增明细</el-button>
                              <el-button icon="el-icon-caret-top" @click="MainOpenDialog(6)" v-has="'PDELETE'">插入明细</el-button>
                              <el-button icon="el-icon-delete" @click="MainOpenDialog(7)" v-has="'PDELETE'">删除明细</el-button>
                          </div>
                      </div>
                  </rm-layout-top>
              </template>
          </rm-layout-right>
      </div>
  </div>
</template>

<script>
import XEUtils from "xe-utils"
import axios from "axios";
export default {
  name: "LIS844",
  data() {
      return {
          lxTableLoading: false,
          rptItemLoading: false,
          coverflag: false,
          changeflag: false,
          rpt_itemdialog: false,
          dialogTableVisible: false,
          dlgTestGroupNo: false,
          isdisabeld: true,
          operatetype: 2, //1:新增 2:修改 3:删除
          detailData: {}, // 新增 修改 字段
          oDetailData: {},
          txtrptunit: "",
          utype: "",
          txtSearch: "",
          selrow: {},
          selrow2: {},
          tempTestGroup: {},
          searchList: [],
          oSearchList: [],
          detailData: {}, // 新增 修改 字段
          oDetailData: {},
          detailxTData: [],
          oDetailxTData: [],
          selRptItem4Options: [],
          selTestGroupOptions: [],
          allMediumgroupnoList: [],
          keyConfig: {
              isDel: true,
              isTab: true,
              isEdit: true,
          },
          keyLocalConfig: {
              isArrow: true,
          },
          form: {},
          showFile: false,
          url: "",
          updata: { action: "BACCOMMOMUPLOAD" }, 
      }
  },
  created() {
      this.ddlGetTestGroup()
      this.btnQuery()
  },
  mounted() {
      this.url = this.$tool.baseUrl.replace(/api/, "z") + "fileupload";
  },
  methods: {
      getRow(row) {
          this.tempTestGroup = row
          this.dlgTestGroupNo = true
      },
      testgroupChange(c, v) {
          this.tempTestGroup.testgroupno = c
          this.tempTestGroup.testgroupname = v
          this.dlgTestGroupNo = false
      },

      //下拉框

      async ddlGetTestGroup() {
          try {
              const res = await this.$tool.request({
                  url: "ucent/ddl",
                  method: "post",
                  data: {
                      action: "bacttestgroup",
                  },
              })
              this.selTestGroupOptions = res.Data
          } catch (e) {
              this.$message.warning(e)
              // this.$message.warning(e.message);
          }
      },
      filterData() {
          let filterName = this.txtSearch.trim()
          let queryList = []
          if (filterName) {
              queryList = this.oSearchList.filter(
                  (item) =>
                      item.testno
                          .toUpperCase()
                          .indexOf(filterName.toUpperCase()) > -1 ||
                      item.testname
                          .toUpperCase()
                          .indexOf(filterName.toUpperCase()) > -1 ||
                      item.inputcode
                          .toUpperCase()
                          .indexOf(filterName.toUpperCase()) > -1
              )
              this.searchList = queryList
              if (queryList.length > 0) {
                  this.$refs.lxTable.setCurrentRow(queryList[0])
                  this.detailQuery(queryList[0].testno)
                  this.selrow = this.$refs.lxTable.getCurrentRow()
              } else {
                  this.detailData = []
              }
          } else {
              this.searchList = XEUtils.clone(this.oSearchList, true)
              if (this.searchList.length > 0) {
                  this.$refs.lxTable.setCurrentRow(this.searchList[0])
                  this.detailQuery(this.searchList[0].testno)
                  this.selrow = this.$refs.lxTable.getCurrentRow()
              }
          }
      },
      //查询条件
      btnQuery() {
          this.lxTableLoading = true
          this.isdisabeld = true
          this.$tool
              .request({
                  url: "LIS/LIS8/LIS844",
                  method: "post",
                  data: {
                      action: "querylist",
                  },
              })
              .then((response) => {
                  this.lxTableLoading = false
                  if (response.length > 0) {
                      var tempList = []
                      response.forEach((element) => {
                          tempList.push(element.testno)
                          element.updateflag = 0
                      })
                      this.oSearchList = XEUtils.clone(response, true)
                      this.searchList = response

                      this.allMediumgroupnoList = tempList
                      this.selrow = response[0]
                      this.$refs.lxTable.setCurrentRow(this.selrow)
                      this.detailQuery(this.selrow.testno)
                  } else {
                      this.oSearchList = []
                      this.searchList = []
                      this.detailData = {}
                      this.detailxTData = []
                  }
              })
              .catch((e) => {
                  this.lxTableLoading = false
                  console.log("error", e)
              })
      },
      // 查询明细
      detailQuery(testno) {
          this.rptItemLoading = true
          this.isdisabeld = true
          this.$tool
              .request({
                  url: "LIS/LIS8/LIS844",
                  method: "post",
                  data: {
                      action: "querydetail",
                      testno: testno,
                  },
              })
              .then((response) => {
                  this.rptItemLoading = false
                  this.oDetailData = XEUtils.clone(response.data[0], true)
                  this.detailData = response.data[0]
                  this.oDetailxTData = XEUtils.clone(response.details, true)
                  this.detailxTData = response.details
                  if (response.details.length > 0) {
                      this.$refs.rxTable.setCurrentRow(response.details[0])
                  }
              })
              .catch((e) => {
                  this.rptItemLoading = false
                  console.log("error", e)
              })
      },
      CurrentChangeEvent(e) {
          if (this.changeflag) {
              this.$refs.lxTable.setCurrentRow(this.selrow)
              return false
          }
          this.selrow = e.row
          this.oDetailData = XEUtils.clone(e.row, true)
          this.detailData = XEUtils.clone(e.row, true)
          this.detailQuery(this.selrow.testno)
      },
      MainOpenDialog(k) {
          if (k == 1) {
              // 新增
              this.operatetype = 1
              this.hasChange()
              this.$refs["input11"].focus()
              this.detailData = {
                  testtype: "",
              }
              this.detailxTData = []
              this.isdisabeld = false
          }
          if (k == 2) {
              var that = this
              that.$confirm("你确定删除这条记录?", "提示", {
                  confirmButtonText: "确定",
                  cancelButtonText: "取消",
                  type: "warning",
              }).then(() => {
                  that.operatetype = 3
                  let delData = XEUtils.clone(this.detailData, true)
                  if (delData.seq == "") {
                      delData.seq = 0
                  }
                  that.$tool
                      .request({
                          url: "LIS/LIS8/LIS844",
                          method: "post",
                          data: {
                              action: "savedata",
                              testno: this.detailData.testno,
                              utype: that.operatetype,
                              bacttest: delData,
                              bacttestshape: this.$refs.rxTable.getRecordset(),
                          },
                      })
                      .then((response) => {
                          if (response.errcode != "1") {
                              that.$message({
                                  message: "保存失败！" + response.errmsg,
                                  type: "warning",
                              })
                          } else {
                              that.$message({
                                  message: "删除成功",
                                  type: "success",
                              })
                              // that.btnQuery();
                              that.changeflag = false
                              that.operatetype = 2
                              // 删除不刷新表格
                              var delrow = this.$refs.lxTable.getCurrentRow()
                              var alld = this.$refs.lxTable.getTableData()
                                  .fullData
                              var rowindex = alld.indexOf(delrow)
                              this.searchList.splice(rowindex, 1)
                              this.$refs.lxTable
                                  .loadData(this.searchList)
                                  .then(() => {
                                      var havedata = this.$refs.lxTable.getTableData()
                                          .fullData
                                      if (havedata.length > 0) {
                                          if (rowindex >= havedata.length)
                                              rowindex = havedata.length - 1
                                          this.oSearchList = XEUtils.clone(
                                              havedata,
                                              true
                                          )
                                          this.oDetailData = XEUtils.clone(
                                              havedata[rowindex],
                                              true
                                          )
                                          this.detailData = XEUtils.clone(
                                              havedata[rowindex],
                                              true
                                          )
                                          let selectrow = havedata[rowindex]
                                          this.$refs.lxTable.setCurrentRow(
                                              selectrow
                                          )
                                          this.selrow = this.$refs.lxTable.getCurrentRow()
                                          this.detailQuery(selectrow.testno)
                                      }
                                  })
                              if (
                                  this.allMediumgroupnoList.indexOf(
                                      delrow.testno
                                  ) != -1
                              ) {
                                  this.allMediumgroupnoList.splice(
                                      this.allMediumgroupnoList.indexOf(
                                          delrow.testno
                                      ),
                                      1
                                  )
                              }
                              this.oSearchList = XEUtils.clone(havedata, true)
                          }
                      })
                      .catch((e) => {})
              })
          }
          if (k == 3) {
              this.btnSave()
          }
          if (k == 4) {
              // 取消
              if (this.operatetype == 1) {
                  this.detailxTData = []
              } else {
                  if (
                      this.detailData.dyeingmethodno == undefined ||
                      this.detailData.dyeingmethodno == ""
                  ) {
                      this.detailxTData = []
                  } else {
                      this.detailQuery(this.selrow.testno)
                  }
              }
              this.operatetype = 2
              this.changeflag = false
              this.isdisabeld = true
              this.detailData = XEUtils.clone(this.oDetailData, true)
              this.$nextTick(() => {
                  this.$refs.lxTable.setCurrentRow(this.selrow)
              })
          }
          if (k == 5) {
              this.$refs.rxTable
                  .insert({
                      testno: this.detailData.testno,
                      seq:
                          this.$refs.rxTable.tableFullData.length > 0
                              ? (Math.floor(
                                    this.$refs.rxTable.tableFullData[
                                        this.$refs.rxTable.tableFullData
                                            .length - 1
                                    ].seq / 10
                                ) +
                                    1) *
                                10
                              : 10,
                      testname: "",
                      inputcode: "",
                      testtype: "",
                  })
                  .then(({ row }) => {
                      this.$nextTick(() => {
                          this.$refs.rxTable.setCurrentRow(row)
                      })
                  })
              this.hasChange()
          }
          if (k == 6) {
              var newRow = {
                  testno: this.detailData.testno,
                  dyeingresult: "",
                  gram: "",
                  testgroupno: "",
                  testgroupname: "",
                  seq:
                      this.$refs.rxTable.tableFullData.length > 0
                          ? (Math.floor(
                                this.$refs.rxTable.tableFullData[
                                    this.$refs.rxTable.tableFullData.length -
                                        1
                                ].seq / 10
                            ) +
                                1) *
                            10
                          : 10,
                  comments: "",
                  inputcode: "",
              }
              let row = this.$refs.rxTable.getCurrentRow()
              var havedata = this.$refs.rxTable.getTableData().fullData
              if (row && havedata.length > 0) {
                  newRow.seq = (row.seq / 10 - 1) * 10
                  this.$refs.rxTable.insertAt(newRow, row).then(({ row }) => {
                      this.$nextTick(() => {
                          this.$refs.rxTable.setCurrentRow(row)
                          this.$refs.rxTable.setActiveRow(row)
                      })
                  })
              } else {
                  this.$refs.rxTable.insert(newRow).then(({ row }) => {
                      this.$nextTick(() => {
                          this.$refs.rxTable.setCurrentRow(row)
                          this.$refs.rxTable.setActiveRow(row)
                      })
                  })
              }
              this.hasChange()
          }
          if (k == 7) {
              var delrow = this.$refs.rxTable.getCurrentRow()
              var havedata = this.$refs.rxTable.getTableData().fullData
              if (delrow && havedata.length > 0) {
                  var rowindex = havedata.indexOf(delrow)
                  this.$refs.rxTable.remove(delrow)
                  if (havedata.length > 0) {
                      if (rowindex >= havedata.length)
                          rowindex = havedata.length - 1
                      let selectrow = havedata[rowindex]
                      this.$refs.rxTable.setCurrentRow(selectrow)
                  }
                  this.hasChange()
              } else {
                  this.$message({
                      message: "请先选中要删除的明细！",
                      type: "warning",
                  })
              }
          }
      },
      hasChange() {
          this.changeflag = true
      },

      rowClassName({ row, rowIndex }) {
          if (row.updateflag == 1) {
              return "row-modify row--current"
          }
          if (row.updateflag == 2) {
              return "row-new row--current"
          }
      },
      rowClassName2({ row, rowIndex }) {
          let isDirty = this.$refs.rxTable.hasRowChange(row)
          if (isDirty) {
              return "row-modify"
          }
          if (this.$refs.rxTable.hasRowInsert(row)) {
              return "row-new"
          }
      },

      CellDblclick({ row, column }) {
          // 报告项目弹窗
          if (column.property == "rpt_itemname") {
              this.selrow2 = row
              this.rpt_itemdialog = true
              this.changeflag = true
          }
      },
      rpt_itemchange(code, name) {
          this.selrow2.rpt_itemcode = code
          this.selrow2.rpt_itemname = name
          this.rpt_itemdialog = false
      },
      btnSave() {
          var that = this
          if (
              this.detailData.testno == undefined ||
              this.detailData.testno == ""
          ) {
              if ((this.operatetype = 2)) {
                  this.$alert("请通过新增按钮来增加数据。", "信息", {
                      confirmButtonText: "确定",
                      callback: (action) => {},
                  })
                  this.MainOpenDialog(4)
                  return false
              } else {
                  this.$alert("试验代码不可为空", "信息", {
                      confirmButtonText: "确定",
                      callback: (action) => {},
                  })
                  return false
              }
          }
          if (
              this.detailData.testname == undefined ||
              this.detailData.testname == ""
          ) {
              this.$alert("试验名称不可为空", "信息", {
                  confirmButtonText: "确定",
                  callback: (action) => {},
              })
              return false
          }
          // 排序
          that.$refs.rxTable.tableFullData.sort((a, b) => {
              return a.seq - b.seq
          })
          that.$refs.rxTable.tableFullData.forEach((element, index) => {
              element.seq = (index + 1) * 10
          })
          that.$tool
              .request({
                  url: "LIS/LIS8/LIS844",
                  method: "post",
                  data: {
                      action: "savedata",
                      utype: that.operatetype,
                      testno: that.detailData.testno,
                      bacttest: that.detailData,
                      bacttestshape: that.$refs.rxTable.getRecordset(),
                  },
              })
              .then((response) => {
                  if (response.errcode != "1") {
                      this.$message({
                          message: "保存失败！" + response.errmsg,
                          type: "warning",
                      })
                  } else {
                      this.$message({
                          message: "保存成功",
                          type: "success",
                      })
                      this.changeflag = false
                      this.isdisabeld = true
                      if (this.operatetype == 1) {
                          that.operatetype = 2
                          that.$tool
                              .request({
                                  url: "LIS/LIS8/LIS844",
                                  method: "post",
                                  data: {
                                      action: "querydetail",
                                      testno: that.detailData.testno,
                                  },
                              })
                              // 新增不更新表格操作
                              .then((response) => {
                                  this.oDetailxTData = XEUtils.clone(
                                      response.details,
                                      true
                                  )
                                  this.detailxTData = response.details
                                  response.data[0].updateflag = 2
                                  that.oDetailData = XEUtils.clone(
                                      response.data[0],
                                      true
                                  )
                                  that.detailData = response.data[0]
                                  that.oSearchList.push(response.data[0])

                                  that.searchList.push(response.data[0])
                                  that.$refs.lxTable
                                      .loadData(that.searchList)
                                      .then(() => {
                                          var lastrow =
                                              that.$refs.lxTable
                                                  .tableFullData[
                                                  that.$refs.lxTable
                                                      .tableFullData.length -
                                                      1
                                              ]
                                          that.$refs.lxTable
                                              .setCurrentRow(lastrow)
                                              .then(() => {
                                                  that.selrow = that.$refs.lxTable.getCurrentRow()
                                              })
                                      })
                                  that.allMediumgroupnoList.push(
                                      that.detailData.testno
                                  )
                              })
                              .catch((e) => {})
                          return false
                      }
                      if (this.operatetype == 2) {
                          that.$tool
                              .request({
                                  url: "LIS/LIS8/LIS844",
                                  method: "post",
                                  data: {
                                      action: "querydetail",
                                      testno: that.detailData.testno,
                                  },
                              })
                              .then((response) => {
                                  this.oDetailxTData = XEUtils.clone(
                                      response.details,
                                      true
                                  )
                                  this.detailxTData = response.details
                                  var fcurmedium = that.oSearchList.filter(
                                      (t) => t.testno == that.selrow.testno
                                  )
                                  that.detailData.updateflag = 1
                                  Object.keys(that.detailData).forEach(
                                      (key) => {
                                          if (
                                              that.selrow.hasOwnProperty(key)
                                          ) {
                                              that.selrow[key] =
                                                  that.detailData[key]
                                              fcurmedium[0][key] =
                                                  that.detailData[key]
                                          }
                                      }
                                  )
                                  that.oDetailData = XEUtils.clone(
                                      that.detailData,
                                      true
                                  )
                              })
                              .catch((e) => {})
                          return false
                      }
                  }
              })
              .catch((e) => {})
      },
      nextFocus(id, index) {
          if (index <= 4) {
              var that = this
              var focusIndex = index + 1
              setTimeout(function () {
                  if (index < 4) {
                      that.$refs["input" + id + focusIndex].focus()
                  }
                  if (index == 4) {
                      that.$refs["input" + id + focusIndex].$el.focus()
                  }
              }, 1)
          }
      },
      btnExport() {
          let p = { prgno: "LIS844" }
          this.$pub.commexport(this, p, `鉴定试验.dat`)
      },
      EditClose({ row, column, rowIndex }) {
          if (column.property == "shapes") {
              row.inputcode = this.$pub.CreateInputcode(row.shapes, this, 16)
          }
      },
      TxtInputCode() {
          this.detailData.inputcode = this.$pub.CreateInputcode(
              this.detailData.testname,
              this,
              16
          )
      },
      format({ cellValue, row, column }) {
          if (column.property == "testtype") {
              if (row.testtype == "1") {
                  return "生化反应"
              } else if (row.testtype == "2") {
                  return "血清试验"
              } else if (row.testtype == "9") {
                  return "其他"
              } else {
                  return cellValue
              }
          } else {
              return cellValue
          }
      },
      ImportCsv() {
          this.$refs["upload"].$refs["upload-inner"].handleClick();
      },
      // 上传文件之前的钩子, 参数为上传的文件,若返回 false 或者返回 Promise 且被 reject，则停止上传
      beforeUploadFile(file) {
          let extension = file.name.substring(file.name.lastIndexOf(".") + 1);
          let size = file.size / 1024 / 1024;
          if (extension !== "dat") {
              this.$notify.warning({
                  title: "警告",
                  message: `只能上传DAT(*dat)文件，且不超过10M`,
              });
          }
          if (size > 10) {
              this.$notify.warning({
                  title: "警告",
                  message: `文件大小不得超过10M`,
              });
          }
      },
      uploadOpt(content) {
          let formData = new FormData();
          formData.append("action", "BACCOMMOMUPLOAD");
          formData.append("file", content.file);
          this.$pub.uploadFileOpt(this, formData, "QueryList");
      },
      // 文件状态改变时的钩子
      fileChange(file, fileList) {
          this.form.file = file.raw;
      },
  },
}
</script>

<style scoped>
.pagetop {
  width: 100%;
  height: 35px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
  font-size: 12px;
}
.pagetop .top-table {
  float: right;
}
.top-table {
  display: flex;
  padding: 0px 2px 0px 5px;
  margin: 2px 0;
}
.pagecenter {
  position: absolute;
  top: 40px;
  width: 100%;
  left: 0;
  bottom: 0px;
  overflow: auto;
  z-index: 999;
  white-space: nowrap;
}
.pagecenter-left {
  height: 100%;
  border: solid 1px #cccccc;
}
.pagecenter-right-top {
  width: 100%;
}
.pagecenter-right-top table {
  font-size: 12px;
  width: 100%;
}
.top-deal {
  right: 5px;
  position: absolute;
  top: 5px;
  display: flex;
  align-items: center;
}
.search-title {
  margin: 0 5px 0 20px;
  font-size: 12px;
}
.dialog-footer {
  margin: 10px 0 0 0;
}
.dialog-footer label {
  margin: 0 5px 0 10px;
}

/deep/ .mytable-style.vxe-table .vxe-body--column.col-orange {
  background-color: #ccc;
}
/deep/ .el-input.is-disabled .el-input__inner {
  color: #000000 !important;
}
/deep/ .el-textarea .el-textarea__inner {
  width: 96.5% !important;
}
/deep/ .el-textarea__inner {
  padding: 2px 5px !important;
}
/deep/ .search-textarea .el-textarea__inner {
  width: 100% !important;
}
/deep/ .fixedpart {
  border: solid 1px #cccccc;
}
/deep/ .el-button.is-disabled {
  border: 0px;
  color: grey;
  background-color: #e6e6e6;
  font-weight: normal;
}
.upload-button {
  height: 24px;
  margin: 0 10px;
  display: none;
}
.upload-button div {
  height: 24px;
}
</style>
